
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimal-ui">
    <meta name="author" content="">
    <title>添加门店</title>
    <% include("../inc/input_css.html"){}%>
    <style>
        label{
            width: 140px!important;
        }
    </style>

    <%
    var isAdd = false;
    var isEdit = false;
    if(isEmpty(admin.id)){
        isAdd = true;
    }else{
        isEdit = true;
    }
    %>

</head>
<body>

<div class="ibox">
    <div class="ibox-title">
        <div class="pull-left mbx navbar_title">
            <span class="current">权限管理</span>
            <span class="line">/</span>
            <span class="current"><a href="/sys/user/list">用户管理</a></span><span class="line">/</span>
            <%if(isAdd){%>添加用户<%}else{%>编辑用户<%}%>
        </div>
    </div>
    <div class="ibox-content">
        <div class="wrapper wrapper-content">
            <div class="row">
                <div class="padding-40">
                    <form class="form-horizontal form-validate" method="post" id="form" action="<%if (isAdd){%>/sys/user/save<%}else{%>/sys/user/update<%}%>">
                        <input type="hidden" name="admin.id" value="${admin.id!}"/>
                        <div class="form-group">
                            <label class="col-sm-2 control-label "><span class="maroon">*</span>登录名</label>
                            <div class="col-sm-3">
                                <%if (isAdd){%>
                                <input type="text" name="admin.username" placeholder="请输入登录名(数字、字母、下划线)" value="${admin.username!}" class="form-control light-input" required="true">
                                <%}else{%>
                                ${admin.username!}
                                <input type="hidden" name="admin.username" class="form-control light-input" value="${admin.username!}" />
                                <%}%>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label "><span class="maroon">*</span>密码</label>
                            <div class="col-sm-3">
                                <%if(isAdd){%>
                                <input type="password" name="rePassword" placeholder="请确认密码" value="" class="form-control light-input" required="true">
                                <%}else{%>
                                <input type="password" name="rePassword" value="" class="form-control light-input">
                                <%}%>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label "><span class="maroon">*</span>重复密码</label>
                            <div class="col-sm-3">
                                <%if(isAdd){%>
                                <input type="password" name="admin.password" placeholder="字母、数字或者英文符号" value="" class="form-control light-input" required="true">
                                <%}else{%>
                                <input type="password" name="admin.password"  value="" class="form-control light-input">
                                <%}%>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">手机号</label>
                            <div class="col-sm-3">
                                <input type="text" name="admin.phone" placeholder="请输入手机号" value="${admin.phone!}" class="form-control light-input" >
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">E-mail</label>
                            <div class="col-sm-3">
                                <input type="text" name="admin.email" placeholder="请输入邮箱" value="${admin.email!}" class="form-control light-input">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">头像</label>
                            <div class="col-sm-3">
                                <input type="hidden" name="admin.headImg" value="" class="pull-left form-control light-input"/>
                                <img class="img-rounded" src="${admin.headImg!}" style="max-height:50px;"/>
                                <input type="button" class="button browserButton" value="选择文件" style="line-height: normal"/>
                                <span class="help-block"><span class="maroon"></span>建议300*300像素；格式jpg</span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label "><span class="maroon">*</span>角色</label>
                            <div class="col-sm-3 col-md-3  col-lg-2">
                                <select name="admin.roleId" value="${admin.roleId!}" class="form-control light-input">
                                    <%for(list in roleList){%>
                                    <option value="${list.id}" <%if (list.id == admin.roleId!){%> selected<%}%>>
                                    ${list.name}
                                    </option>
                                    <%}%>
                                </select>
                            </div>
                        </div>

                        <div class="form-group" style="margin-top: 24px">
                            <label class="col-sm-2 control-label "></label>
                            <div class="col-sm-4 col-sm-offset-0">
                                <button class="hive-btn-cancle" id="btn_cancle" type="button" onclick="history.back()">&nbsp;取消&nbsp;</button>
                                <button class="hive-btn hive-btn-primary margin-left-8" type="submit">&nbsp;提交&nbsp;
                                </button>
                            </div>
                        </div>

                    </form>


                </div>
            </div>
        </div>
    </div>
</div>

<% include("../inc/input_js.html"){}%>
<script type="text/javascript">
    var uploadUrl="/file/uploadfile?shopId=plateform&type=d";
    var browserUrl="/file/browser?shopId=plateform";
</script>
<script src="https://static.9hive.cn/global/vendor/file/file.js"></script>
<script type="text/javascript">
    $(function () {
        $("input.browserButton").browser();
    })
</script>
</body>
</html>